package com.wangyadong.hobby.front.model;

import com.wangyadong.hobby.front.model.bean.My;
import com.wangyadong.hobby.front.model.bean.MyInteger;
import com.wangyadong.hobby.front.model.bean.MyString;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyFirstConfiogruation implements BeanNameAware {


    @Bean
    public My<String> my2(MyFirstAutowireContainer myFirstAutowireContainer) {
        System.out.println("myFirstAutowireContainer-->" + myFirstAutowireContainer.hashCode());
        return new MyString();
    }


    @Bean
    public My<String> my1() {
        return new MyInteger();
    }


    public String beanName;

    @Override
    public void setBeanName(String s) {
        this.beanName = s;
        System.out.println("MyFirstConfiogruation beanName is -> " + s);
    }
}
